//
//  Holdings_TableVC.h
//  KaChing_App
//
//  Created by Jordan Robert Yust on 2/11/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataManager.h"
#import "AsyncImageView.h"

@interface Holdings_TableVC : UITableViewController <UITableViewDataSource, UITableViewDelegate>
{
	IBOutlet UISegmentedControl *segmentedControl;	// The segmentControl used in transitioning between different types of stocks
	NSMutableArray *curStockArray;		// The current array of stocks (which are dictionary objects) to display in the TableView
	
	IBOutlet UIActivityIndicatorView *activityIndicator;
	
	/*** TableView variables ***/
	UILabel *stockTickerLabel;			// The UILabel that stores the stock ticker (this is added to the TableView)
	UILabel *currentPriceLabel;			// The UILabel that stores the stock's current price (this is added to the TableView)
	UILabel *currentPriceChangeLabel;	// The UILabel that stores the stock's price change (this is added to the TableView)
	UILabel *actionLabel;				// The UILabel that stores the order's action (Buy, sell, short, etc). (this is added to the TableView)
	UILabel *quantityLabel;				// The UILabel that stores the order's quantity. (this is added to the TableView)
	
	/*** DataManager variables ***/
	DataManager *dataManager;		// The DataManager object used to retrieve stock information
	NSDictionary *portfolio;			// NSDictionary that stores portfolio information (obtained from DataManager)
	NSDictionary *pendingOrders;	// NSDictionary that stores pending orders (obtained from DataManager)
	
	int currentSecond_Column;
}

/*** PROPERTIES ***/
@property(nonatomic, retain) NSMutableArray *curStockArray;
@property(nonatomic, retain) IBOutlet UISegmentedControl *segmentedControl;

@property(nonatomic, retain) UIActivityIndicatorView *activityIndicator;

@property(nonatomic, retain) UILabel *stockTickerLabel;
@property(nonatomic, retain) UILabel *currentPriceLabel;
@property(nonatomic, retain) UILabel *currentPriceChangeLabel;
@property(nonatomic, retain) UILabel *actionLabel;
@property(nonatomic, retain) UILabel *quantityLabel;

@property(nonatomic, retain) IBOutlet DataManager *dataManager;
@property(nonatomic, retain) NSDictionary *portfolio;
@property(nonatomic, retain) NSDictionary *pendingOrders;

/*** METHODS ***/
- (void) segmentedControlButtonPressed:(UISegmentedControl *)control;

- (void) getPendingOrdersArray;
- (void) getShortHoldingsArray;
- (void) getLongHoldingsArray;

- (IBAction) refreshHoldings;
-(NSString *) checkDisplayString:(NSString *) data;

@end
